<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.

$dirname = dirname(__FILE__);
if (defined('YII_DEBUG') && YII_DEBUG) {
	$language = 'en';
	$params = "$dirname/params-test.php";
} else {
	$language = 'id';
	$params = "$dirname/params.php";
}

return array(
	'basePath'=>"$dirname/..",
	'name'=>'Abip My Home Management',
	'theme'=>'freeport',
	// preloading 'log' component
	'preload'=>array('log'),
	'language'=>$language,
	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.extensions.*',
	),
	'defaultController'=>'site',
	'modules'=>array(
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'LetMeIn',
			// If removed, Gii defaults to localhost only.
			// Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1', '::1'),
		),
	),
	// Put website under maintenance mode
//	  'catchAllRequest'=>array(
//	  'site/page',
//	  'view'=>'maintenance'
//	  ),
	// application components
	'components'=>array(
		'db'=>array(
			'connectionString'=>"sqlite:$dirname/../data/haruna.db",
		),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format
//		'urlManager'=>array(
//			'showScriptName'=>false,
//			'urlFormat'=>'path',
//			'rules'=>array(
//				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
//				'<controller:\w+>/<action:\w+>/<id:\d+>'=>
//				'<controller>/<action>',
//				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
//			),
//		),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
			// uncomment the following to show log messages on web pages
			/*
			  array(
			  'class'=>'CWebLogRoute',
			  ),
			 */
			),
		),
	),
	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>require($params),
);
